import fasttext
import os
import numpy as np
import time


def train_model(ipt=None, opt=None, model='', dim=0,
                epoch=5, lr=0, loss='ova', bucket=400000,
                wordNgrams=2, thread=1):
    np.set_printoptions(suppress=True)
    if os.path.isfile(model):
        classifier = fasttext.load_model(model)
    else:
        classifier = fasttext.train_supervised(ipt, label='__label__', dim=dim, epoch=epoch,
                                               lr=lr, wordNgrams=wordNgrams, loss=loss,
                                               bucket=bucket, thread=thread)
        """
          训练一个监督模型, 返回一个模型对象

          @param input:           训练数据文件路径
          @param lr:              学习率
          @param dim:             向量维度
          @param ws:              cbow模型时使用
          @param epoch:           次数
          @param minCount:        词频阈值, 小于该值在初始化时会过滤掉
          @param minCountLabel:   类别阈值，类别小于该值初始化时会过滤掉
          @param minn:            构造subword时最小char个数
          @param maxn:            构造subword时最大char个数
          @param neg:             负采样
          @param wordNgrams:      n-gram个数
          @param loss:            损失函数类型, softmax, ns: 负采样, hs: 分层softmax
          @param bucket:          词扩充大小, [A, B]: A语料中包含的词向量, B不在语料中的词向量
          @param thread:          线程个数, 每个线程处理输入数据的一段, 0号线程负责loss输出
          @param lrUpdateRate:    学习率更新
          @param t:               负采样阈值
          @param label:           类别前缀
          @param verbose:         ??
          @param pretrainedVectors: 预训练的词向量文件路径, 如果word出现在文件夹中初始化不再随机
          @return model object
        """
        classifier.save_model(opt)
    return classifier


def trainmodel():
    dim = 300
    lr = 0.1
    epoch = 5
    thread = 32
    bucket = 2000000
    model = f'data_dim{str(dim)}_lr0{str(lr)}_iter{str(epoch)}.model'

    result_file = open('/tmp2/result.txt', 'a+', encoding='utf-8')
    result_file.write('\n')
    result_file.write(model)
    start = time.time()
    classifier = train_model(ipt='/tmp2/100000char.txt',
                             opt=model,
                             model=model,
                             dim=dim, epoch=epoch, lr=lr, thread=thread, bucket=bucket)
    train_time = time.time() - start
    result_file.write("训练耗时:\t" + str(train_time))
    result = classifier.test('/tmp2/testchar.txt')
    result_file.write("测试集准确度:\t" + str(result))


def getMostValueKey(dict):
    max_key = None
    for item in dict.keys():
        if max_key is None:
            max_key = item
            continue
        else:
            if dict[max_key] < dict[item]:
                max_key = item
    return max_key


def LoopTrain(linenum):
    model_rate = {}
    count = 0
    result_file = open('/tmp/result.txt', 'a+', encoding='utf-8')
    result_file.write('\n\n\n\n\n')
    result_file.write(str(time.asctime(time.localtime(time.time()))))
    result_file.write('\n')
    for item4 in [100, 200, 300]:
        for item in [200000, 1000000, 2000000]:
            for item0 in [5, 10, 30, 50]:  # 修改epoch
                for item1 in [0.1, 0.3, 0.5, 0.8, 1]:  # 多次修改学习率
                    for item2 in ['char', 'char_filter', 'word', 'word_filter']:
                        for item3 in [True, False]:
                            dim = item4
                            lr = item1
                            epoch = item0
                            bucket = item
                            thread = 32
                            parent_package = '/tmp2/thefile/'
                            model = f'data_dim{str(dim)}_lr0{str(lr)}_iter{str(epoch)}_type_{item2}_redundancy_{str(item3)}_wordnum_{str(linenum)}_bucket_{str(bucket)}.model'
                            if item3:
                                trainfilepath = parent_package + str(linenum) + "_redundancy_" + item2 + '_shuf.txt'
                            else:
                                trainfilepath = parent_package + str(linenum) + item2 + '_shuf.txt'
                            testfilepath = parent_package + 'test' + item2 + '.txt'
                            # trainfilepath ='1000.txt'
                            # testfilepath = '1000.txt'
                            result_file.write(model)
                            start = time.time()
                            classifier = train_model(ipt=trainfilepath,
                                                     opt=model,
                                                     model=model,
                                                     dim=dim, epoch=epoch, lr=lr,
                                                     thread=thread, bucket=bucket)
                            train_time = time.time() - start
                            result_file.write("训练耗时:\t" + str(train_time))
                            result = classifier.test(testfilepath)
                            # result = (0,0)
                            print(result)
                            if model in model_rate.keys():
                                print('repeat model', model)
                            if len(model_rate.keys()) == 0:
                                model_rate[model] = result[1]
                            else:
                                if model_rate[getMostValueKey(model_rate)] < result[1]:
                                    if os.path.exists(getMostValueKey(model_rate)):
                                        os.remove(getMostValueKey(model_rate))
                                else:
                                    if os.path.exists(model):
                                        os.remove(model)
                            model_rate[model] = result[1]
                            result_file.write("测试集准确度:\t" + testfilepath + '\t' + str(result))
                            result_file.write("\n")
                            result_file.flush()
                            count += 1
                            print(count, str(model_rate))
    result_file.write("model_rate:\n")
    result_file.write(str(model_rate))


def getMaxValue():
    a = {'data_dim100_lr00.1_iter5_type_char_redundancy_True_wordnum_1000.model': 0.6794601987346502,
         'data_dim100_lr00.1_iter5_type_char_redundancy_False_wordnum_1000.model': 0.6766592806007098,
         'data_dim100_lr00.1_iter5_type_char_filter_redundancy_True_wordnum_1000.model': 0.6640505304730652,
         'data_dim100_lr00.1_iter5_type_char_filter_redundancy_False_wordnum_1000.model': 0.6648205086570166,
         'data_dim100_lr00.1_iter5_type_word_redundancy_True_wordnum_1000.model': 0.6632128201076819,
         'data_dim100_lr00.1_iter5_type_word_redundancy_False_wordnum_1000.model': 0.6661859399068468,
         'data_dim100_lr00.1_iter5_type_word_filter_redundancy_True_wordnum_1000.model': 0.6609529660727694,
         'data_dim100_lr00.1_iter5_type_word_filter_redundancy_False_wordnum_1000.model': 0.6637288303886707,
         'data_dim100_lr00.3_iter5_type_char_redundancy_True_wordnum_1000.model': 0.6700330252566349,
         'data_dim100_lr00.3_iter5_type_char_redundancy_False_wordnum_1000.model': 0.6757335927291426,
         'data_dim100_lr00.3_iter5_type_char_filter_redundancy_True_wordnum_1000.model': 0.650346097336766,
         'data_dim100_lr00.3_iter5_type_char_filter_redundancy_False_wordnum_1000.model': 0.656618538665214,
         'data_dim100_lr00.3_iter5_type_word_redundancy_True_wordnum_1000.model': 0.6581743168528618,
         'data_dim100_lr00.3_iter5_type_word_redundancy_False_wordnum_1000.model': 0.6574957178387817,
         'data_dim100_lr00.3_iter5_type_word_filter_redundancy_True_wordnum_1000.model': 0.6550133735470619,
         'data_dim100_lr00.3_iter5_type_word_filter_redundancy_False_wordnum_1000.model': 0.6545026343715674,
         'data_dim100_lr00.5_iter5_type_char_redundancy_True_wordnum_1000.model': 0.6639978318892514,
         'data_dim100_lr00.5_iter5_type_char_redundancy_False_wordnum_1000.model': 0.6700701322865616,
         'data_dim100_lr00.5_iter5_type_char_filter_redundancy_True_wordnum_1000.model': 0.6448174444581213,
         'data_dim100_lr00.5_iter5_type_char_filter_redundancy_False_wordnum_1000.model': 0.6499421206875329,
         'data_dim100_lr00.5_iter5_type_word_redundancy_True_wordnum_1000.model': 0.6550306030529401,
         'data_dim100_lr00.5_iter5_type_word_redundancy_False_wordnum_1000.model': 0.6548763760042856,
         'data_dim100_lr00.5_iter5_type_word_filter_redundancy_True_wordnum_1000.model': 0.6509200131563433,
         'data_dim100_lr00.5_iter5_type_word_filter_redundancy_False_wordnum_1000.model': 0.6509665568236119,
         'data_dim100_lr00.8_iter5_type_char_redundancy_True_wordnum_1000.model': 0.6594349924593215,
         'data_dim100_lr00.8_iter5_type_char_redundancy_False_wordnum_1000.model': 0.6655556645206434,
         'data_dim100_lr00.8_iter5_type_char_filter_redundancy_True_wordnum_1000.model': 0.6398086578023147,
         'data_dim100_lr00.8_iter5_type_char_filter_redundancy_False_wordnum_1000.model': 0.6438536622414746,
         'data_dim100_lr00.8_iter5_type_word_redundancy_True_wordnum_1000.model': 0.6508362568276944,
         'data_dim100_lr00.8_iter5_type_word_redundancy_False_wordnum_1000.model': 0.651045879714233,
         'data_dim100_lr00.8_iter5_type_word_filter_redundancy_True_wordnum_1000.model': 0.6470184126747714,
         'data_dim100_lr00.8_iter5_type_word_filter_redundancy_False_wordnum_1000.model': 0.6473851767728482,
         'data_dim100_lr01_iter5_type_char_redundancy_True_wordnum_1000.model': 0.6575074147797301,
         'data_dim100_lr01_iter5_type_char_redundancy_False_wordnum_1000.model': 0.6628388998295727,
         'data_dim100_lr01_iter5_type_char_filter_redundancy_True_wordnum_1000.model': 0.6376931820265093,
         'data_dim100_lr01_iter5_type_char_filter_redundancy_False_wordnum_1000.model': 0.6422790044758255,
         'data_dim100_lr01_iter5_type_word_redundancy_True_wordnum_1000.model': 0.648782204338879,
         'data_dim100_lr01_iter5_type_word_redundancy_False_wordnum_1000.model': 0.6492725834037847,
         'data_dim100_lr01_iter5_type_word_filter_redundancy_True_wordnum_1000.model': 0.6453993136360533,
         'data_dim100_lr01_iter5_type_word_filter_redundancy_False_wordnum_1000.model': 0.6457666983163604,
         'data_dim100_lr00.1_iter10_type_char_redundancy_True_wordnum_1000.model': 0.6744931577287318,
         'data_dim100_lr00.1_iter10_type_char_redundancy_False_wordnum_1000.model': 0.6789513023242253,
         'data_dim100_lr00.1_iter10_type_char_filter_redundancy_True_wordnum_1000.model': 0.6550085247584652,
         'data_dim100_lr00.1_iter10_type_char_filter_redundancy_False_wordnum_1000.model': 0.6606150920962002,
         'data_dim100_lr00.1_iter10_type_word_redundancy_True_wordnum_1000.model': 0.6606746835355386,
         'data_dim100_lr00.1_iter10_type_word_redundancy_False_wordnum_1000.model': 0.6605727048339793,
         'data_dim100_lr00.1_iter10_type_word_filter_redundancy_True_wordnum_1000.model': 0.6575670694245341,
         'data_dim100_lr00.1_iter10_type_word_filter_redundancy_False_wordnum_1000.model': 0.6577222149820962,
         'data_dim100_lr00.3_iter10_type_char_redundancy_True_wordnum_1000.model': 0.6599180464739045,
         'data_dim100_lr00.3_iter10_type_char_redundancy_False_wordnum_1000.model': 0.6643569749289003,
         'data_dim100_lr00.3_iter10_type_char_filter_redundancy_True_wordnum_1000.model': 0.6422947183163144,
         'data_dim100_lr00.3_iter10_type_char_filter_redundancy_False_wordnum_1000.model': 0.6441882360952154,
         'data_dim100_lr00.3_iter10_type_word_redundancy_True_wordnum_1000.model': 0.6578110964158264,
         'data_dim100_lr00.3_iter10_type_word_redundancy_False_wordnum_1000.model': 0.6568800686404791,
         'data_dim100_lr00.3_iter10_type_word_filter_redundancy_True_wordnum_1000.model': 0.6541110469842807,
         'data_dim100_lr00.3_iter10_type_word_filter_redundancy_False_wordnum_1000.model': 0.6535388701679916,
         'data_dim100_lr00.5_iter10_type_char_redundancy_True_wordnum_1000.model': 0.6558336226798167,
         'data_dim100_lr00.5_iter10_type_char_redundancy_False_wordnum_1000.model': 0.6583913572426296,
         'data_dim100_lr00.5_iter10_type_char_filter_redundancy_True_wordnum_1000.model': 0.6383276283362448,
         'data_dim100_lr00.5_iter10_type_char_filter_redundancy_False_wordnum_1000.model': 0.6392036749434956,
         'data_dim100_lr00.5_iter10_type_word_redundancy_True_wordnum_1000.model': 0.654394180415431,
         'data_dim100_lr00.5_iter10_type_word_redundancy_False_wordnum_1000.model': 0.6542456188501964,
         'data_dim100_lr00.5_iter10_type_word_filter_redundancy_True_wordnum_1000.model': 0.6505985515610746,
         'data_dim100_lr00.5_iter10_type_word_filter_redundancy_False_wordnum_1000.model': 0.6495522499208758,
         'data_dim100_lr00.8_iter10_type_char_redundancy_True_wordnum_1000.model': 0.6528180138727282,
         'data_dim100_lr00.8_iter10_type_char_redundancy_False_wordnum_1000.model': 0.6546143916965069,
         'data_dim100_lr00.8_iter10_type_char_filter_redundancy_True_wordnum_1000.model': 0.6357885336105953,
         'data_dim100_lr00.8_iter10_type_char_filter_redundancy_False_wordnum_1000.model': 0.63546378090716,
         'data_dim100_lr00.8_iter10_type_word_redundancy_True_wordnum_1000.model': 0.6498536102034097,
         'data_dim100_lr00.8_iter10_type_word_redundancy_False_wordnum_1000.model': 0.6504333780067193,
         'data_dim100_lr00.8_iter10_type_word_filter_redundancy_True_wordnum_1000.model': 0.6461502181346539,
         'data_dim100_lr00.8_iter10_type_word_filter_redundancy_False_wordnum_1000.model': 0.6453614581200082,
         'data_dim100_lr01_iter10_type_char_redundancy_True_wordnum_1000.model': 0.6512840357605748,
         'data_dim100_lr01_iter10_type_char_redundancy_False_wordnum_1000.model': 0.6528279532557443,
         'data_dim100_lr01_iter10_type_char_filter_redundancy_True_wordnum_1000.model': 0.6343245274717216,
         'data_dim100_lr01_iter10_type_char_filter_redundancy_False_wordnum_1000.model': 0.6341477467662225,
         'data_dim100_lr01_iter10_type_word_redundancy_True_wordnum_1000.model': 0.6470687103534192,
         'data_dim100_lr01_iter10_type_word_redundancy_False_wordnum_1000.model': 0.6476938020240883,
         'data_dim100_lr01_iter10_type_word_filter_redundancy_True_wordnum_1000.model': 0.6428989878303825,
         'data_dim100_lr01_iter10_type_word_filter_redundancy_False_wordnum_1000.model': 0.643365045085299,
         'data_dim100_lr00.1_iter30_type_char_redundancy_True_wordnum_1000.model': 0.660333512683978,
         'data_dim100_lr00.1_iter30_type_char_redundancy_False_wordnum_1000.model': 0.662579150620085,
         'data_dim100_lr00.1_iter30_type_char_filter_redundancy_True_wordnum_1000.model': 0.6443388270665664,
         'data_dim100_lr00.1_iter30_type_char_filter_redundancy_False_wordnum_1000.model': 0.6448501816258063,
         'data_dim100_lr00.1_iter30_type_word_redundancy_True_wordnum_1000.model': 0.6601484230756399,
         'data_dim100_lr00.1_iter30_type_word_redundancy_False_wordnum_1000.model': 0.6590253983621717,
         'data_dim100_lr00.1_iter30_type_word_filter_redundancy_True_wordnum_1000.model': 0.656847194037446,
         'data_dim100_lr00.1_iter30_type_word_filter_redundancy_False_wordnum_1000.model': 0.6554788102197482,
         'data_dim100_lr00.3_iter30_type_char_redundancy_True_wordnum_1000.model': 0.6541783840948667,
         'data_dim100_lr00.3_iter30_type_char_redundancy_False_wordnum_1000.model': 0.654338076848659,
         'data_dim100_lr00.3_iter30_type_char_filter_redundancy_True_wordnum_1000.model': 0.6381298958434273,
         'data_dim100_lr00.3_iter30_type_char_filter_redundancy_False_wordnum_1000.model': 0.6379858523056132,
         'data_dim100_lr00.3_iter30_type_word_redundancy_True_wordnum_1000.model': 0.6569581264120431,
         'data_dim100_lr00.3_iter30_type_word_redundancy_False_wordnum_1000.model': 0.6560094726882781,
         'data_dim100_lr00.3_iter30_type_word_filter_redundancy_True_wordnum_1000.model': 0.6530337162325694,
         'data_dim100_lr00.3_iter30_type_word_filter_redundancy_False_wordnum_1000.model': 0.6514133760293908,
         'data_dim100_lr00.5_iter30_type_char_redundancy_True_wordnum_1000.model': 0.6513768033353919,
         'data_dim100_lr00.5_iter30_type_char_redundancy_False_wordnum_1000.model': 0.6516014333915561,
         'data_dim100_lr00.5_iter30_type_char_filter_redundancy_True_wordnum_1000.model': 0.6354094372088029,
         'data_dim100_lr00.5_iter30_type_char_filter_redundancy_False_wordnum_1000.model': 0.6351567062742746,
         'data_dim100_lr00.5_iter30_type_word_redundancy_True_wordnum_1000.model': 0.6534946275479725,
         'data_dim100_lr00.5_iter30_type_word_redundancy_False_wordnum_1000.model': 0.6530665688006864,
         'data_dim100_lr00.5_iter30_type_word_filter_redundancy_True_wordnum_1000.model': 0.6499090847032686,
         'data_dim100_lr00.5_iter30_type_word_filter_redundancy_False_wordnum_1000.model': 0.6478195843340222,
         'data_dim100_lr00.8_iter30_type_char_redundancy_True_wordnum_1000.model': 0.6488349717854047,
         'data_dim100_lr00.8_iter30_type_char_redundancy_False_wordnum_1000.model': 0.6490450240798119,
         'data_dim100_lr00.8_iter30_type_char_filter_redundancy_True_wordnum_1000.model': 0.6321808977317072,
         'data_dim100_lr00.8_iter30_type_char_filter_redundancy_False_wordnum_1000.model': 0.6321848261918294,
         'data_dim100_lr00.8_iter30_type_word_redundancy_True_wordnum_1000.model': 0.6483862499976394,
         'data_dim100_lr00.8_iter30_type_word_redundancy_False_wordnum_1000.model': 0.6481344507345299,
         'data_dim100_lr00.8_iter30_type_word_filter_redundancy_True_wordnum_1000.model': 0.6450964695076922,
         'data_dim100_lr00.8_iter30_type_word_filter_redundancy_False_wordnum_1000.model': 0.6429939369116104,
         'data_dim100_lr01_iter30_type_char_redundancy_True_wordnum_1000.model': 0.6473546663415384,
         'data_dim100_lr01_iter30_type_char_redundancy_False_wordnum_1000.model': 0.6482445724342477,
         'data_dim100_lr01_iter30_type_char_filter_redundancy_True_wordnum_1000.model': 0.6306789164783189,
         'data_dim100_lr01_iter30_type_char_filter_redundancy_False_wordnum_1000.model': 0.631067179287063,
         'data_dim100_lr01_iter30_type_word_redundancy_True_wordnum_1000.model': 0.6444455915299764,
         'data_dim100_lr01_iter30_type_word_redundancy_False_wordnum_1000.model': 0.6442945119721107,
         'data_dim100_lr01_iter30_type_word_filter_redundancy_True_wordnum_1000.model': 0.6417018847082333,
         'data_dim100_lr01_iter30_type_word_filter_redundancy_False_wordnum_1000.model': 0.640037483166707,
         'data_dim100_lr00.1_iter50_type_char_redundancy_True_wordnum_1000.model': 0.6584138865107995,
         'data_dim100_lr00.1_iter50_type_char_redundancy_False_wordnum_1000.model': 0.6584543066683983,
         'data_dim100_lr00.1_iter50_type_char_filter_redundancy_True_wordnum_1000.model': 0.6424787011987041,
         'data_dim100_lr00.1_iter50_type_char_filter_redundancy_False_wordnum_1000.model': 0.6426214352498107,
         'data_dim100_lr00.1_iter50_type_word_redundancy_True_wordnum_1000.model': 0.6598934763217416,
         'data_dim100_lr00.1_iter50_type_word_redundancy_False_wordnum_1000.model': 0.6586678434085562,
         'data_dim100_lr00.1_iter50_type_word_filter_redundancy_True_wordnum_1000.model': 0.6563147344838928,
         'data_dim100_lr00.1_iter50_type_word_filter_redundancy_False_wordnum_1000.model': 0.6551077020460596,
         'data_dim100_lr00.3_iter50_type_char_redundancy_True_wordnum_1000.model': 0.6525582646632404,
         'data_dim100_lr00.3_iter50_type_char_redundancy_False_wordnum_1000.model': 0.6523084548367688,
         'data_dim100_lr00.3_iter50_type_char_filter_redundancy_True_wordnum_1000.model': 0.6366861867485183,
         'data_dim100_lr00.3_iter50_type_char_filter_redundancy_False_wordnum_1000.model': 0.63608840606659,
         'data_dim100_lr00.3_iter50_type_word_redundancy_True_wordnum_1000.model': 0.6568800686404791,
         'data_dim100_lr00.3_iter50_type_word_redundancy_False_wordnum_1000.model': 0.6552515569063188,
         'data_dim100_lr00.3_iter50_type_word_filter_redundancy_True_wordnum_1000.model': 0.6528400945767319,
         'data_dim100_lr00.3_iter50_type_word_filter_redundancy_False_wordnum_1000.model': 0.6510559206647677,
         'data_dim100_lr00.5_iter50_type_char_redundancy_True_wordnum_1000.model': 0.6493100742935749,
         'data_dim100_lr00.5_iter50_type_char_redundancy_False_wordnum_1000.model': 0.6494962720687434,
         'data_dim100_lr00.5_iter50_type_char_filter_redundancy_True_wordnum_1000.model': 0.6336285352867383,
         'data_dim100_lr00.5_iter50_type_char_filter_redundancy_False_wordnum_1000.model': 0.6331361682847557,
         'data_dim100_lr00.5_iter50_type_word_redundancy_True_wordnum_1000.model': 0.6537118044124044,
         'data_dim100_lr00.5_iter50_type_word_redundancy_False_wordnum_1000.model': 0.6523785273142398,
         'data_dim100_lr00.5_iter50_type_word_filter_redundancy_True_wordnum_1000.model': 0.6498159973687313,
         'data_dim100_lr00.5_iter50_type_word_filter_redundancy_False_wordnum_1000.model': 0.6477711789200628,
         'data_dim100_lr00.8_iter50_type_char_redundancy_True_wordnum_1000.model': 0.6462832008524015,
         'data_dim100_lr00.8_iter50_type_char_redundancy_False_wordnum_1000.model': 0.6468219154118747,
         'data_dim100_lr00.8_iter50_type_char_filter_redundancy_True_wordnum_1000.model': 0.6305767765151415,
         'data_dim100_lr00.8_iter50_type_char_filter_redundancy_False_wordnum_1000.model': 0.6305852881787397,
         'data_dim100_lr00.8_iter50_type_word_redundancy_True_wordnum_1000.model': 0.6475760858685847,
         'data_dim100_lr00.8_iter50_type_word_redundancy_False_wordnum_1000.model': 0.6470296814676372,
         'data_dim100_lr00.8_iter50_type_word_filter_redundancy_True_wordnum_1000.model': 0.644249374763403,
         'data_dim100_lr00.8_iter50_type_word_filter_redundancy_False_wordnum_1000.model': 0.6422635116266081,
         'data_dim100_lr01_iter50_type_char_redundancy_True_wordnum_1000.model': 0.64483668931079,
         'data_dim100_lr01_iter50_type_char_redundancy_False_wordnum_1000.model': 0.6454284139130159,
         'data_dim100_lr01_iter50_type_char_filter_redundancy_True_wordnum_1000.model': 0.6287611731953309,
         'data_dim100_lr01_iter50_type_char_filter_redundancy_False_wordnum_1000.model': 0.629081997438644,
         'data_dim100_lr01_iter50_type_word_redundancy_True_wordnum_1000.model': 0.6418067352525892,
         'data_dim100_lr01_iter50_type_word_redundancy_False_wordnum_1000.model': 0.6423292187235414,
         'data_dim100_lr01_iter50_type_word_filter_redundancy_True_wordnum_1000.model': 0.6403384655483775,
         'data_dim100_lr01_iter50_type_word_filter_redundancy_False_wordnum_1000.model': 0.638873270902761,
         'data_dim200_lr00.1_iter5_type_char_redundancy_True_wordnum_1000.model': 0.6786047491697302,
         'data_dim200_lr00.1_iter5_type_char_redundancy_False_wordnum_1000.model': 0.6761411074328031,
         'data_dim200_lr00.1_iter5_type_char_filter_redundancy_True_wordnum_1000.model': 0.6621897498618492,
         'data_dim200_lr00.1_iter5_type_char_filter_redundancy_False_wordnum_1000.model': 0.6642751074433844,
         'data_dim200_lr00.1_iter5_type_word_redundancy_True_wordnum_1000.model': 0.6602088548987861,
         'data_dim200_lr00.1_iter5_type_word_redundancy_False_wordnum_1000.model': 0.664939533554455,
         'data_dim200_lr00.1_iter5_type_word_filter_redundancy_True_wordnum_1000.model': 0.6576421598743941,
         'data_dim200_lr00.1_iter5_type_word_filter_redundancy_False_wordnum_1000.model': 0.6623318997883815,
         'data_dim200_lr00.3_iter5_type_char_redundancy_True_wordnum_1000.model': 0.6678861185251546,
         'data_dim200_lr00.3_iter5_type_char_redundancy_False_wordnum_1000.model': 0.6739875744459788,
         'data_dim200_lr00.3_iter5_type_char_filter_redundancy_True_wordnum_1000.model': 0.6463934117104777,
         'data_dim200_lr00.3_iter5_type_char_filter_redundancy_False_wordnum_1000.model': 0.6537821904569847,
         'data_dim200_lr00.3_iter5_type_word_redundancy_True_wordnum_1000.model': 0.6503427302719998,
         'data_dim200_lr00.3_iter5_type_word_redundancy_False_wordnum_1000.model': 0.6514720499670458,
         'data_dim200_lr00.3_iter5_type_word_filter_redundancy_True_wordnum_1000.model': 0.6468434084858414,
         'data_dim200_lr00.3_iter5_type_word_filter_redundancy_False_wordnum_1000.model': 0.6479399772866904,
         'data_dim200_lr00.5_iter5_type_char_redundancy_True_wordnum_1000.model': 0.6612260692788249,
         'data_dim200_lr00.5_iter5_type_char_redundancy_False_wordnum_1000.model': 0.6681027970749058,
         'data_dim200_lr00.5_iter5_type_char_filter_redundancy_True_wordnum_1000.model': 0.6382817963014857,
         'data_dim200_lr00.5_iter5_type_char_filter_redundancy_False_wordnum_1000.model': 0.6458650338240417,
         'data_dim200_lr00.5_iter5_type_word_redundancy_True_wordnum_1000.model': 0.6463019815972508,
         'data_dim200_lr00.5_iter5_type_word_redundancy_False_wordnum_1000.model': 0.6475213195288584,
         'data_dim200_lr00.5_iter5_type_word_filter_redundancy_True_wordnum_1000.model': 0.6424534097890641,
         'data_dim200_lr00.5_iter5_type_word_filter_redundancy_False_wordnum_1000.model': 0.644164354997859,
         'data_dim200_lr00.8_iter5_type_char_redundancy_True_wordnum_1000.model': 0.6560966850169765,
         'data_dim200_lr00.8_iter5_type_char_redundancy_False_wordnum_1000.model': 0.6626699303182988,
         'data_dim200_lr00.8_iter5_type_char_filter_redundancy_True_wordnum_1000.model': 0.6339185865924275,
         'data_dim200_lr00.8_iter5_type_char_filter_redundancy_False_wordnum_1000.model': 0.6406519672418806,
         'data_dim200_lr00.8_iter5_type_word_redundancy_True_wordnum_1000.model': 0.6409858696548525,
         'data_dim200_lr00.8_iter5_type_word_redundancy_False_wordnum_1000.model': 0.64389603963824,
         'data_dim200_lr00.8_iter5_type_word_filter_redundancy_True_wordnum_1000.model': 0.6378604807029955,
         'data_dim200_lr00.8_iter5_type_word_filter_redundancy_False_wordnum_1000.model': 0.6394392418967475,
         'data_dim200_lr01_iter5_type_char_redundancy_True_wordnum_1000.model': 0.6536959927058181,
         'data_dim200_lr01_iter5_type_char_redundancy_False_wordnum_1000.model': 0.6609981260949886,
         'data_dim200_lr01_iter5_type_char_filter_redundancy_True_wordnum_1000.model': 0.6316701979158209,
         'data_dim200_lr01_iter5_type_char_filter_redundancy_False_wordnum_1000.model': 0.6378202022371271,
         'data_dim200_lr01_iter5_type_word_redundancy_True_wordnum_1000.model': 0.6387989930547469,
         'data_dim200_lr01_iter5_type_word_redundancy_False_wordnum_1000.model': 0.6412106004971776,
         'data_dim200_lr01_iter5_type_word_filter_redundancy_True_wordnum_1000.model': 0.6354290395248823,
         'data_dim200_lr01_iter5_type_word_filter_redundancy_False_wordnum_1000.model': 0.6373857352968555,
         'data_dim200_lr00.1_iter10_type_char_redundancy_True_wordnum_1000.model': 0.6721858956179249,
         'data_dim200_lr00.1_iter10_type_char_redundancy_False_wordnum_1000.model': 0.6772715465945023,
         'data_dim200_lr00.1_iter10_type_char_filter_redundancy_True_wordnum_1000.model': 0.6504495467866506,
         'data_dim200_lr00.1_iter10_type_char_filter_redundancy_False_wordnum_1000.model': 0.6575914872888126,
         'data_dim200_lr00.1_iter10_type_word_redundancy_True_wordnum_1000.model': 0.6530596443209509,
         'data_dim200_lr00.1_iter10_type_word_redundancy_False_wordnum_1000.model': 0.655665137195976,
         'data_dim200_lr00.1_iter10_type_word_filter_redundancy_True_wordnum_1000.model': 0.6503106014062393,
         'data_dim200_lr00.1_iter10_type_word_filter_redundancy_False_wordnum_1000.model': 0.6524590570873594,
         'data_dim200_lr00.3_iter10_type_char_redundancy_True_wordnum_1000.model': 0.6551497931283081,
         'data_dim200_lr00.3_iter10_type_char_redundancy_False_wordnum_1000.model': 0.6607966879325288,
         'data_dim200_lr00.3_iter10_type_char_filter_redundancy_True_wordnum_1000.model': 0.6337791262580894,
         'data_dim200_lr00.3_iter10_type_char_filter_redundancy_False_wordnum_1000.model': 0.6381744183914789,
         'data_dim200_lr00.3_iter10_type_word_redundancy_True_wordnum_1000.model': 0.6483491096063307,
         'data_dim200_lr00.3_iter10_type_word_redundancy_False_wordnum_1000.model': 0.6491762701856453,
         'data_dim200_lr00.3_iter10_type_word_filter_redundancy_True_wordnum_1000.model': 0.6447278436629246,
         'data_dim200_lr00.3_iter10_type_word_filter_redundancy_False_wordnum_1000.model': 0.6452789206833851,
         'data_dim200_lr00.5_iter10_type_char_redundancy_True_wordnum_1000.model': 0.6500131199855813,
         'data_dim200_lr00.5_iter10_type_char_redundancy_False_wordnum_1000.model': 0.6545342140068436,
         'data_dim200_lr00.5_iter10_type_char_filter_redundancy_True_wordnum_1000.model': 0.6293962742484202,
         'data_dim200_lr00.5_iter10_type_char_filter_redundancy_False_wordnum_1000.model': 0.6318260268340016,
         'data_dim200_lr00.5_iter10_type_word_redundancy_True_wordnum_1000.model': 0.6442724795365886,
         'data_dim200_lr00.5_iter10_type_word_redundancy_False_wordnum_1000.model': 0.6459186172191667,
         'data_dim200_lr00.5_iter10_type_word_filter_redundancy_True_wordnum_1000.model': 0.6401014031364226,
         'data_dim200_lr00.5_iter10_type_word_filter_redundancy_False_wordnum_1000.model': 0.6416398264852085,
         'data_dim200_lr00.8_iter10_type_char_redundancy_True_wordnum_1000.model': 0.6465694550832656,
         'data_dim200_lr00.8_iter10_type_char_redundancy_False_wordnum_1000.model': 0.6494160943790801,
         'data_dim200_lr00.8_iter10_type_char_filter_redundancy_True_wordnum_1000.model': 0.6260197627733881,
         'data_dim200_lr00.8_iter10_type_char_filter_redundancy_False_wordnum_1000.model': 0.6280763116473604,
         'data_dim200_lr00.8_iter10_type_word_redundancy_True_wordnum_1000.model': 0.6395348764011842,
         'data_dim200_lr00.8_iter10_type_word_redundancy_False_wordnum_1000.model': 0.6414435148155538,
         'data_dim200_lr00.8_iter10_type_word_filter_redundancy_True_wordnum_1000.model': 0.6348630685308957,
         'data_dim200_lr00.8_iter10_type_word_filter_redundancy_False_wordnum_1000.model': 0.6369091281440247,
         'data_dim200_lr01_iter10_type_char_redundancy_True_wordnum_1000.model': 0.6450527052350068,
         'data_dim200_lr01_iter10_type_char_redundancy_False_wordnum_1000.model': 0.6480517484037351,
         'data_dim200_lr01_iter10_type_char_filter_redundancy_True_wordnum_1000.model': 0.6243691547787098,
         'data_dim200_lr01_iter10_type_char_filter_redundancy_False_wordnum_1000.model': 0.6263340395831641,
         'data_dim200_lr01_iter10_type_word_redundancy_True_wordnum_1000.model': 0.6362274930802415,
         'data_dim200_lr01_iter10_type_word_redundancy_False_wordnum_1000.model': 0.6377571736036315,
         'data_dim200_lr01_iter10_type_word_filter_redundancy_True_wordnum_1000.model': 0.6326575192845928,
         'data_dim200_lr01_iter10_type_word_filter_redundancy_False_wordnum_1000.model': 0.6338726192914192,
         'data_dim200_lr00.1_iter30_type_char_redundancy_True_wordnum_1000.model': 0.6536409947864623,
         'data_dim200_lr00.1_iter30_type_char_redundancy_False_wordnum_1000.model': 0.6571045384548103,
         'data_dim200_lr00.1_iter30_type_char_filter_redundancy_True_wordnum_1000.model': 0.6340482257764601,
         'data_dim200_lr00.1_iter30_type_char_filter_redundancy_False_wordnum_1000.model': 0.6361165600307991,
         'data_dim200_lr00.1_iter30_type_word_redundancy_True_wordnum_1000.model': 0.6504692594017124,
         'data_dim200_lr00.1_iter30_type_word_redundancy_False_wordnum_1000.model': 0.650186614728872,
         'data_dim200_lr00.1_iter30_type_word_filter_redundancy_True_wordnum_1000.model': 0.6467708003649023,
         'data_dim200_lr00.1_iter30_type_word_filter_redundancy_False_wordnum_1000.model': 0.6473839356083878,
         'data_dim200_lr00.3_iter30_type_char_redundancy_True_wordnum_1000.model': 0.6455987086753585,
         'data_dim200_lr00.3_iter30_type_char_redundancy_False_wordnum_1000.model': 0.6467079438199567,
         'data_dim200_lr00.3_iter30_type_char_filter_redundancy_True_wordnum_1000.model': 0.6265147487487854,
         'data_dim200_lr00.3_iter30_type_char_filter_redundancy_False_wordnum_1000.model': 0.6275479337609244,
         'data_dim200_lr00.3_iter30_type_word_redundancy_True_wordnum_1000.model': 0.6460659197880857,
         'data_dim200_lr00.3_iter30_type_word_redundancy_False_wordnum_1000.model': 0.6466677200269173,
         'data_dim200_lr00.3_iter30_type_word_filter_redundancy_True_wordnum_1000.model': 0.6420326550369557,
         'data_dim200_lr00.3_iter30_type_word_filter_redundancy_False_wordnum_1000.model': 0.6424397569799987,
         'data_dim200_lr00.5_iter30_type_char_redundancy_True_wordnum_1000.model': 0.6423942515909639,
         'data_dim200_lr00.5_iter30_type_char_redundancy_False_wordnum_1000.model': 0.6437559470641713,
         'data_dim200_lr00.5_iter30_type_char_filter_redundancy_True_wordnum_1000.model': 0.6233484098902912,
         'data_dim200_lr00.5_iter30_type_char_filter_redundancy_False_wordnum_1000.model': 0.6249243771426476,
         'data_dim200_lr00.5_iter30_type_word_redundancy_True_wordnum_1000.model': 0.6418514296217912,
         'data_dim200_lr00.5_iter30_type_word_redundancy_False_wordnum_1000.model': 0.6428189682902893,
         'data_dim200_lr00.5_iter30_type_word_filter_redundancy_True_wordnum_1000.model': 0.638183804044955,
         'data_dim200_lr00.5_iter30_type_word_filter_redundancy_False_wordnum_1000.model': 0.6380820285591943,
         'data_dim200_lr00.8_iter30_type_char_redundancy_True_wordnum_1000.model': 0.6396052607166428,
         'data_dim200_lr00.8_iter30_type_char_redundancy_False_wordnum_1000.model': 0.641391036531871,
         'data_dim200_lr00.8_iter30_type_char_filter_redundancy_True_wordnum_1000.model': 0.6197453572148789,
         'data_dim200_lr00.8_iter30_type_char_filter_redundancy_False_wordnum_1000.model': 0.6213082296001613,
         'data_dim200_lr00.8_iter30_type_word_redundancy_True_wordnum_1000.model': 0.6349332448678588,
         'data_dim200_lr00.8_iter30_type_word_redundancy_False_wordnum_1000.model': 0.637385769690545,
         'data_dim200_lr00.8_iter30_type_word_filter_redundancy_True_wordnum_1000.model': 0.6311221988469582,
         'data_dim200_lr00.8_iter30_type_word_filter_redundancy_False_wordnum_1000.model': 0.6313660876634458,
         'data_dim200_lr01_iter30_type_char_redundancy_True_wordnum_1000.model': 0.6381587491750312,
         'data_dim200_lr01_iter30_type_char_redundancy_False_wordnum_1000.model': 0.6402672236255158,
         'data_dim200_lr01_iter30_type_char_filter_redundancy_True_wordnum_1000.model': 0.6178492204625631,
         'data_dim200_lr01_iter30_type_char_filter_redundancy_False_wordnum_1000.model': 0.6198946386995225,
         'data_dim200_lr01_iter30_type_word_redundancy_True_wordnum_1000.model': 0.6300823320640552,
         'data_dim200_lr01_iter30_type_word_redundancy_False_wordnum_1000.model': 0.6336906155044137,
         'data_dim200_lr01_iter30_type_word_filter_redundancy_True_wordnum_1000.model': 0.6271039289060997,
         'data_dim200_lr01_iter30_type_word_filter_redundancy_False_wordnum_1000.model': 0.6275017221156889,
         'data_dim200_lr00.1_iter50_type_char_redundancy_True_wordnum_1000.model': 0.6500409502580263,
         'data_dim200_lr00.1_iter50_type_char_redundancy_False_wordnum_1000.model': 0.6512456034795792,
         'data_dim200_lr00.1_iter50_type_char_filter_redundancy_True_wordnum_1000.model': 0.6313421714956171,
         'data_dim200_lr00.1_iter50_type_char_filter_redundancy_False_wordnum_1000.model': 0.6322516100139067,
         'data_dim200_lr00.1_iter50_type_word_redundancy_True_wordnum_1000.model': 0.6494601738548013,
         'data_dim200_lr00.1_iter50_type_word_redundancy_False_wordnum_1000.model': 0.6492373315069494,
         'data_dim200_lr00.1_iter50_type_word_filter_redundancy_True_wordnum_1000.model': 0.6458436505129113,
         'data_dim200_lr00.1_iter50_type_word_filter_redundancy_False_wordnum_1000.model': 0.6460689218624914,
         'data_dim200_lr00.3_iter50_type_char_redundancy_True_wordnum_1000.model': 0.6432159072536292,
         'data_dim200_lr00.3_iter50_type_char_redundancy_False_wordnum_1000.model': 0.6441608112656942,
         'data_dim200_lr00.3_iter50_type_char_filter_redundancy_True_wordnum_1000.model': 0.6241661843390628,
         'data_dim200_lr00.3_iter50_type_char_filter_redundancy_False_wordnum_1000.model': 0.6252628794565106,
         'data_dim200_lr00.3_iter50_type_word_redundancy_True_wordnum_1000.model': 0.6453445148992771,
         'data_dim200_lr00.3_iter50_type_word_redundancy_False_wordnum_1000.model': 0.6456913683842104,
         'data_dim200_lr00.3_iter50_type_word_filter_redundancy_True_wordnum_1000.model': 0.6400529977224633,
         'data_dim200_lr00.3_iter50_type_word_filter_redundancy_False_wordnum_1000.model': 0.640887060239917,
         'data_dim200_lr00.5_iter50_type_char_redundancy_True_wordnum_1000.model': 0.639886876568766,
         'data_dim200_lr00.5_iter50_type_char_redundancy_False_wordnum_1000.model': 0.6409623178111093,
         'data_dim200_lr00.5_iter50_type_char_filter_redundancy_True_wordnum_1000.model': 0.6209500849856873,
         'data_dim200_lr00.5_iter50_type_char_filter_redundancy_False_wordnum_1000.model': 0.6216938734354908,
         'data_dim200_lr00.5_iter50_type_word_redundancy_True_wordnum_1000.model': 0.6407838007462071,
         'data_dim200_lr00.5_iter50_type_word_redundancy_False_wordnum_1000.model': 0.6415687849489509,
         'data_dim200_lr00.5_iter50_type_word_filter_redundancy_True_wordnum_1000.model': 0.6377289172701829,
         'data_dim200_lr00.5_iter50_type_word_filter_redundancy_False_wordnum_1000.model': 0.6364734794183904}
    b = {'data_dim100_lr00.1_iter5_type_char_redundancy_True_wordnum_10000.model': 0.7228118116977261,
         'data_dim100_lr00.1_iter5_type_char_redundancy_False_wordnum_10000.model': 0.7237215965564676,
         'data_dim100_lr00.1_iter5_type_char_filter_redundancy_True_wordnum_10000.model': 0.7033397148985541,
         'data_dim100_lr00.1_iter5_type_char_filter_redundancy_False_wordnum_10000.model': 0.710187020891551,
         'data_dim100_lr00.1_iter5_type_word_redundancy_True_wordnum_10000.model': 0.6953153376596644,
         'data_dim100_lr00.1_iter5_type_word_redundancy_False_wordnum_10000.model': 0.7020805543612577,
         'data_dim100_lr00.1_iter5_type_word_filter_redundancy_True_wordnum_10000.model': 0.6928490309608475,
         'data_dim100_lr00.1_iter5_type_word_filter_redundancy_False_wordnum_10000.model': 0.6991572493313226,
         'data_dim100_lr00.3_iter5_type_char_redundancy_True_wordnum_10000.model': 0.7150113839066812,
         'data_dim100_lr00.3_iter5_type_char_redundancy_False_wordnum_10000.model': 0.7212599426961438,
         'data_dim100_lr00.3_iter5_type_char_filter_redundancy_True_wordnum_10000.model': 0.692943699928502,
         'data_dim100_lr00.3_iter5_type_char_filter_redundancy_False_wordnum_10000.model': 0.7018704708128508,
         'data_dim100_lr00.3_iter5_type_word_redundancy_True_wordnum_10000.model': 0.6868045225665647,
         'data_dim100_lr00.3_iter5_type_word_redundancy_False_wordnum_10000.model': 0.6887307869293521,
         'data_dim100_lr00.3_iter5_type_word_filter_redundancy_True_wordnum_10000.model': 0.6834031488342363,
         'data_dim100_lr00.3_iter5_type_word_filter_redundancy_False_wordnum_10000.model': 0.6862056981860382,
         'data_dim100_lr00.5_iter5_type_char_redundancy_True_wordnum_10000.model': 0.7116253674258588,
         'data_dim100_lr00.5_iter5_type_char_redundancy_False_wordnum_10000.model': 0.7188274443593339,
         'data_dim100_lr00.5_iter5_type_char_filter_redundancy_True_wordnum_10000.model': 0.6896928991773804,
         'data_dim100_lr00.5_iter5_type_char_filter_redundancy_False_wordnum_10000.model': 0.6989293636680294,
         'data_dim100_lr00.5_iter5_type_word_redundancy_True_wordnum_10000.model': 0.6844841923570111,
         'data_dim100_lr00.5_iter5_type_word_redundancy_False_wordnum_10000.model': 0.6866716984552744,
         'data_dim100_lr00.5_iter5_type_word_filter_redundancy_True_wordnum_10000.model': 0.6806887221591297,
         'data_dim100_lr00.5_iter5_type_word_filter_redundancy_False_wordnum_10000.model': 0.6830065967891076,
         'data_dim100_lr00.8_iter5_type_char_redundancy_True_wordnum_10000.model': 0.7096745978525631,
         'data_dim100_lr00.8_iter5_type_char_redundancy_False_wordnum_10000.model': 0.7168680606540909,
         'data_dim100_lr00.8_iter5_type_char_filter_redundancy_True_wordnum_10000.model': 0.6869213705611674,
         'data_dim100_lr00.8_iter5_type_char_filter_redundancy_False_wordnum_10000.model': 0.6962233093871865,
         'data_dim100_lr00.8_iter5_type_word_redundancy_True_wordnum_10000.model': 0.6821430887082509,
         'data_dim100_lr00.8_iter5_type_word_redundancy_False_wordnum_10000.model': 0.6840832020305092,
         'data_dim100_lr00.8_iter5_type_word_filter_redundancy_True_wordnum_10000.model': 0.6784720024326824,
         'data_dim100_lr00.8_iter5_type_word_filter_redundancy_False_wordnum_10000.model': 0.6803399549457301,
         'data_dim100_lr01_iter5_type_char_redundancy_True_wordnum_10000.model': 0.7084513911160469,
         'data_dim100_lr01_iter5_type_char_redundancy_False_wordnum_10000.model': 0.7162332653921285,
         'data_dim100_lr01_iter5_type_char_filter_redundancy_True_wordnum_10000.model': 0.6861749631379492,
         'data_dim100_lr01_iter5_type_char_filter_redundancy_False_wordnum_10000.model': 0.6950827464650406,
         'data_dim100_lr01_iter5_type_word_redundancy_True_wordnum_10000.model': 0.6814242018120734,
         'data_dim100_lr01_iter5_type_word_redundancy_False_wordnum_10000.model': 0.6826844571239362,
         'data_dim100_lr01_iter5_type_word_filter_redundancy_True_wordnum_10000.model': 0.6770316310762757,
         'data_dim100_lr01_iter5_type_word_filter_redundancy_False_wordnum_10000.model': 0.6786581771017569,
         'data_dim100_lr00.1_iter10_type_char_redundancy_True_wordnum_10000.model': 0.7099098299172778,
         'data_dim100_lr00.1_iter10_type_char_redundancy_False_wordnum_10000.model': 0.7179421766453654,
         'data_dim100_lr00.1_iter10_type_char_filter_redundancy_True_wordnum_10000.model': 0.68595038616763,
         'data_dim100_lr00.1_iter10_type_char_filter_redundancy_False_wordnum_10000.model': 0.6954382721060999,
         'data_dim100_lr00.1_iter10_type_word_redundancy_True_wordnum_10000.model': 0.6890593849677099,
         'data_dim100_lr00.1_iter10_type_word_redundancy_False_wordnum_10000.model': 0.6910209012273325,
         'data_dim100_lr00.1_iter10_type_word_filter_redundancy_True_wordnum_10000.model': 0.6862876150404309,
         'data_dim100_lr00.1_iter10_type_word_filter_redundancy_False_wordnum_10000.model': 0.6885167464114833,
         'data_dim100_lr00.3_iter10_type_char_redundancy_True_wordnum_10000.model': 0.6997325643343132,
         'data_dim100_lr00.3_iter10_type_char_redundancy_False_wordnum_10000.model': 0.7078782200287844,
         'data_dim100_lr00.3_iter10_type_char_filter_redundancy_True_wordnum_10000.model': 0.6749945656301642,
         'data_dim100_lr00.3_iter10_type_char_filter_redundancy_False_wordnum_10000.model': 0.6839036584439632,
         'data_dim100_lr00.3_iter10_type_word_redundancy_True_wordnum_10000.model': 0.6837325715566294,
         'data_dim100_lr00.3_iter10_type_word_redundancy_False_wordnum_10000.model': 0.6853887812097318,
         'data_dim100_lr00.3_iter10_type_word_filter_redundancy_True_wordnum_10000.model': 0.6791924984020008,
         'data_dim100_lr00.3_iter10_type_word_filter_redundancy_False_wordnum_10000.model': 0.6814582441246377,
         'data_dim100_lr00.5_iter10_type_char_redundancy_True_wordnum_10000.model': 0.6968806240342232,
         'data_dim100_lr00.5_iter10_type_char_redundancy_False_wordnum_10000.model': 0.7046419569187382,
         'data_dim100_lr00.5_iter10_type_char_filter_redundancy_True_wordnum_10000.model': 0.6720285782379023,
         'data_dim100_lr00.5_iter10_type_char_filter_redundancy_False_wordnum_10000.model': 0.6800301967634726,
         'data_dim100_lr00.5_iter10_type_word_redundancy_True_wordnum_10000.model': 0.6820688079256336,
         'data_dim100_lr00.5_iter10_type_word_redundancy_False_wordnum_10000.model': 0.683363685636174,
         'data_dim100_lr00.5_iter10_type_word_filter_redundancy_True_wordnum_10000.model': 0.6764867598781177,
         'data_dim100_lr00.5_iter10_type_word_filter_redundancy_False_wordnum_10000.model': 0.6787512644362941,
         'data_dim100_lr00.8_iter10_type_char_redundancy_True_wordnum_10000.model': 0.6944951721103563,
         'data_dim100_lr00.8_iter10_type_char_redundancy_False_wordnum_10000.model': 0.7020550668324114,
         'data_dim100_lr00.8_iter10_type_char_filter_redundancy_True_wordnum_10000.model': 0.6697356670132442,
         'data_dim100_lr00.8_iter10_type_char_filter_redundancy_False_wordnum_10000.model': 0.677544136249473,
         'data_dim100_lr00.8_iter10_type_word_redundancy_True_wordnum_10000.model': 0.6801362485812685,
         'data_dim100_lr00.8_iter10_type_word_redundancy_False_wordnum_10000.model': 0.6816017202925656,
         'data_dim100_lr00.8_iter10_type_word_filter_redundancy_True_wordnum_10000.model': 0.673629599290054,
         'data_dim100_lr00.8_iter10_type_word_filter_redundancy_False_wordnum_10000.model': 0.676055455228095,
         'data_dim100_lr01_iter10_type_char_redundancy_True_wordnum_10000.model': 0.6935681589877202,
         'data_dim100_lr01_iter10_type_char_redundancy_False_wordnum_10000.model': 0.7009955286028938,
         'data_dim100_lr01_iter10_type_char_filter_redundancy_True_wordnum_10000.model': 0.6688347401585526,
         'data_dim100_lr01_iter10_type_char_filter_redundancy_False_wordnum_10000.model': 0.6761580445696895,
         'data_dim100_lr01_iter10_type_word_redundancy_True_wordnum_10000.model': 0.6786865143239158,
         'data_dim100_lr01_iter10_type_word_redundancy_False_wordnum_10000.model': 0.6801167341383776,
         'data_dim100_lr01_iter10_type_word_filter_redundancy_True_wordnum_10000.model': 0.6722481832455209,
         'data_dim100_lr01_iter10_type_word_filter_redundancy_False_wordnum_10000.model': 0.6748378728923476,
         'data_dim100_lr00.1_iter30_type_char_redundancy_True_wordnum_10000.model': 0.6836751597590164,
         'data_dim100_lr00.1_iter30_type_char_redundancy_False_wordnum_10000.model': 0.6904438795929889,
         'data_dim100_lr00.1_iter30_type_char_filter_redundancy_True_wordnum_10000.model': 0.658966448331583,
         'data_dim100_lr00.1_iter30_type_char_filter_redundancy_False_wordnum_10000.model': 0.6581781373337279,
         'data_dim100_lr00.1_iter30_type_word_redundancy_True_wordnum_10000.model': 0.6356974556313961,
         'data_dim100_lr00.1_iter30_type_word_redundancy_False_wordnum_10000.model': 0.6389462956236659,
         'data_dim100_lr00.1_iter30_type_word_filter_redundancy_True_wordnum_10000.model': 0.6307349555352832,
         'data_dim100_lr00.1_iter30_type_word_filter_redundancy_False_wordnum_10000.model': 0.633932195185523,
         'data_dim100_lr00.3_iter30_type_char_redundancy_True_wordnum_10000.model': 0.6721600532220829,
         'data_dim100_lr00.3_iter30_type_char_redundancy_False_wordnum_10000.model': 0.677965315529027,
         'data_dim100_lr00.3_iter30_type_char_filter_redundancy_True_wordnum_10000.model': 0.6460097321052094,
         'data_dim100_lr00.3_iter30_type_char_filter_redundancy_False_wordnum_10000.model': 0.6502465763470034,
         'data_dim100_lr00.3_iter30_type_word_redundancy_True_wordnum_10000.model': 0.6278690165413231,
         'data_dim100_lr00.3_iter30_type_word_redundancy_False_wordnum_10000.model': 0.6303152463824314,
         'data_dim100_lr00.3_iter30_type_word_filter_redundancy_True_wordnum_10000.model': 0.620317241636103,
         'data_dim100_lr00.3_iter30_type_word_filter_redundancy_False_wordnum_10000.model': 0.623764575925133,
         'data_dim100_lr00.5_iter30_type_char_redundancy_True_wordnum_10000.model': 0.6701310938357272,
         'data_dim100_lr00.5_iter30_type_char_redundancy_False_wordnum_10000.model': 0.6752657791018508,
         'data_dim100_lr00.5_iter30_type_char_filter_redundancy_True_wordnum_10000.model': 0.6443342438630906,
         'data_dim100_lr00.5_iter30_type_char_filter_redundancy_False_wordnum_10000.model': 0.6479209279546604,
         'data_dim100_lr00.5_iter30_type_word_redundancy_True_wordnum_10000.model': 0.6254964379846742,
         'data_dim100_lr00.5_iter30_type_word_redundancy_False_wordnum_10000.model': 0.6272370003909183,
         'data_dim100_lr00.5_iter30_type_word_filter_redundancy_True_wordnum_10000.model': 0.6165509280807253,
         'data_dim100_lr00.5_iter30_type_word_filter_redundancy_False_wordnum_10000.model': 0.620482316509349,
         'data_dim100_lr00.8_iter30_type_char_redundancy_True_wordnum_10000.model': 0.6687037984346135,
         'data_dim100_lr00.8_iter30_type_char_redundancy_False_wordnum_10000.model': 0.673480665912157,
         'data_dim100_lr00.8_iter30_type_char_filter_redundancy_True_wordnum_10000.model': 0.6428695829808632,
         'data_dim100_lr00.8_iter30_type_char_filter_redundancy_False_wordnum_10000.model': 0.6462402017657118,
         'data_dim100_lr00.8_iter30_type_word_redundancy_True_wordnum_10000.model': 0.6279772902244601,
         'data_dim100_lr00.8_iter30_type_word_redundancy_False_wordnum_10000.model': 0.6284985146990968,
         'data_dim100_lr00.8_iter30_type_word_filter_redundancy_True_wordnum_10000.model': 0.6120560509870361,
         'data_dim100_lr00.8_iter30_type_word_filter_redundancy_False_wordnum_10000.model': 0.6158391202626304,
         'data_dim100_lr01_iter30_type_char_redundancy_True_wordnum_10000.model': 0.667911298295462,
         'data_dim100_lr01_iter30_type_char_redundancy_False_wordnum_10000.model': 0.6727140081688476,
         'data_dim100_lr01_iter30_type_char_filter_redundancy_True_wordnum_10000.model': 0.6423137058735717,
         'data_dim100_lr01_iter30_type_char_filter_redundancy_False_wordnum_10000.model': 0.6473388611132208,
         'data_dim100_lr01_iter30_type_word_redundancy_True_wordnum_10000.model': 0.6260736877953527,
         'data_dim100_lr01_iter30_type_word_redundancy_False_wordnum_10000.model': 0.6307074237347244,
         'data_dim100_lr01_iter30_type_word_filter_redundancy_True_wordnum_10000.model': 0.6101005963795233,
         'data_dim100_lr01_iter30_type_word_filter_redundancy_False_wordnum_10000.model': 0.6137278995153252,
         'data_dim100_lr00.1_iter50_type_char_redundancy_True_wordnum_10000.model': 0.6663865969407904,
         'data_dim100_lr00.1_iter50_type_char_redundancy_False_wordnum_10000.model': 0.671672360828759,
         'data_dim100_lr00.1_iter50_type_char_filter_redundancy_True_wordnum_10000.model': 0.6390275489813503,
         'data_dim100_lr00.1_iter50_type_char_filter_redundancy_False_wordnum_10000.model': 0.6421873404063075,
         'data_dim100_lr00.1_iter50_type_word_redundancy_True_wordnum_10000.model': 0.6288604761398165,
         'data_dim100_lr00.1_iter50_type_word_redundancy_False_wordnum_10000.model': 0.6317970850458307,
         'data_dim100_lr00.1_iter50_type_word_filter_redundancy_True_wordnum_10000.model': 0.6223310309732591,
         'data_dim100_lr00.1_iter50_type_word_filter_redundancy_False_wordnum_10000.model': 0.625818082525025,
         'data_dim100_lr00.3_iter50_type_char_redundancy_True_wordnum_10000.model': 0.6597007052986188,
         'data_dim100_lr00.3_iter50_type_char_redundancy_False_wordnum_10000.model': 0.6634683940872599,
         'data_dim100_lr00.3_iter50_type_char_filter_redundancy_True_wordnum_10000.model': 0.6330595633123728,
         'data_dim100_lr00.3_iter50_type_char_filter_redundancy_False_wordnum_10000.model': 0.6346466612017422,
         'data_dim100_lr00.3_iter50_type_word_redundancy_True_wordnum_10000.model': 0.6219391438950954,
         'data_dim100_lr00.3_iter50_type_word_redundancy_False_wordnum_10000.model': 0.6251218865807989,
         'data_dim100_lr00.3_iter50_type_word_filter_redundancy_True_wordnum_10000.model': 0.6131265553342146,
         'data_dim100_lr00.3_iter50_type_word_filter_redundancy_False_wordnum_10000.model': 0.6168810778272175,
         'data_dim100_lr00.5_iter50_type_char_redundancy_True_wordnum_10000.model': 0.6576127722397008,
         'data_dim100_lr00.5_iter50_type_char_redundancy_False_wordnum_10000.model': 0.6610226432397618,
         'data_dim100_lr00.5_iter50_type_char_filter_redundancy_True_wordnum_10000.model': 0.6317566240385094,
         'data_dim100_lr00.5_iter50_type_char_filter_redundancy_False_wordnum_10000.model': 0.633284140282692,
         'data_dim100_lr00.5_iter50_type_word_redundancy_True_wordnum_10000.model': 0.619192643432729,
         'data_dim100_lr00.5_iter50_type_word_redundancy_False_wordnum_10000.model': 0.6228374377662383,
         'data_dim100_lr00.5_iter50_type_word_filter_redundancy_True_wordnum_10000.model': 0.6095172490830898,
         'data_dim100_lr00.5_iter50_type_word_filter_redundancy_False_wordnum_10000.model': 0.6128212288769324,
         'data_dim100_lr00.8_iter50_type_char_redundancy_True_wordnum_10000.model': 0.6562411373834773,
         'data_dim100_lr00.8_iter50_type_char_redundancy_False_wordnum_10000.model': 0.6587697164227763,
         'data_dim100_lr00.8_iter50_type_char_filter_redundancy_True_wordnum_10000.model': 0.6296352555725206,
         'data_dim100_lr00.8_iter50_type_char_filter_redundancy_False_wordnum_10000.model': 0.6302487500949377,
         'data_dim100_lr00.8_iter50_type_word_redundancy_True_wordnum_10000.model': 0.6158909255952062,
         'data_dim100_lr00.8_iter50_type_word_redundancy_False_wordnum_10000.model': 0.6201091927504474,
         'data_dim100_lr00.8_iter50_type_word_filter_redundancy_True_wordnum_10000.model': 0.6057552796033239,
         'data_dim100_lr00.8_iter50_type_word_filter_redundancy_False_wordnum_10000.model': 0.6091573113895457,
         'data_dim100_lr01_iter50_type_char_redundancy_True_wordnum_10000.model': 0.6553631585503874,
         'data_dim100_lr01_iter50_type_char_redundancy_False_wordnum_10000.model': 0.6580567313477539,
         'data_dim100_lr01_iter50_type_char_filter_redundancy_True_wordnum_10000.model': 0.6289052167331449,
         'data_dim100_lr01_iter50_type_char_filter_redundancy_False_wordnum_10000.model': 0.6297013846512444,
         'data_dim100_lr01_iter50_type_word_redundancy_True_wordnum_10000.model': 0.6142775218168324,
         'data_dim100_lr01_iter50_type_word_redundancy_False_wordnum_10000.model': 0.6182213277752843,
         'data_dim100_lr01_iter50_type_word_filter_redundancy_True_wordnum_10000.model': 0.6037259757104115,
         'data_dim100_lr01_iter50_type_word_filter_redundancy_False_wordnum_10000.model': 0.606964794370078}
    c = b
    print(len(c.keys()))
    print(getMostValueKey(c))


if __name__ == '__main__':
    # LoopTrain(50000)
    # from getMongoData import continueRun
    # continueRun()
    getMaxValue()
